{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "小米粥增加了45千卡路里\n",
      "\n",
      "粗粮馒头增加了223千卡路里\n",
      "\n",
      "全麦面包增加了235千卡路里\n",
      "\n",
      "瘦猪肉增加了143千卡路里\n",
      "\n",
      "鸡翅增加了194千卡路里\n",
      "\n",
      "培根增加了184千卡路里\n",
      "\n",
      "火腿肠增加了212千卡路里\n"
     ]
    }
   ],
   "source": [
    "food_calories = {}\n",
    "\n",
    "food_calories['小米粥'] ='45千卡路里'\n",
    "food_calories['粗粮馒头'] ='223千卡路里'\n",
    "food_calories['全麦面包'] ='235千卡路里'\n",
    "food_calories['瘦猪肉']='143千卡路里'\n",
    "food_calories['鸡翅']='194千卡路里'\n",
    "food_calories['培根']='184千卡路里'\n",
    "food_calories['火腿肠']='212千卡路里'\n",
    "\n",
    "for food, calorie in food_calories.items():\n",
    "    print('\\n%s'% food +'增加了'+'%s'% calorie)\n",
    "    "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "消耗255卡\n",
      "可能是哪一项运动？\n",
      "慢走（一个小时4公里）  慢跑（一个小时9公里）  羽毛球（一个小时）  \n"
     ]
    }
   ],
   "source": [
    "exercise= {'慢走（一个小时4公里）': '消耗255卡',\n",
    "                '慢跑（一个小时9公里）': '消耗655卡',\n",
    "                '羽毛球（一个小时）': '消耗440卡',\n",
    "                }\n",
    "\n",
    "def show_words(exercise):\n",
    "    display_message = \"\"\n",
    "    for word in exercise.keys():\n",
    "        display_message += word + '  '\n",
    "    print(display_message)\n",
    "for meaning in exercise.values():\n",
    "    print('\\n%s'% meaning)\n",
    "    correct = False\n",
    "    while not correct:\n",
    "        print('可能是哪一项运动？')\n",
    "        show_words(exercise)\n",
    "        guessed_word = input('- ')\n",
    "        if exercise[guessed_word] == meaning:\n",
    "            print('正确！')\n",
    "            correct = True\n",
    "        else:\n",
    "            print('对不起！这不是正确答案！')\n",
    " "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "\n",
      "我知道的小刘鸭,她:\n",
      "身高: 168\n",
      "爱好: 喜欢一团米\n",
      "技能:哄一团米开心\n",
      "\n",
      "\n",
      "我知道的崔屎兰,她:\n",
      "身高: 162\n",
      "爱好: 学习\n",
      "技能:疯狂学习不停止\n",
      "\n",
      "\n",
      "我知道的无敌漂亮的龙怡敏,她:\n",
      "身高: 168\n",
      "爱好: 生气\n",
      "技能:只生小刘鸭一个人的气\n"
     ]
    }
   ],
   "source": [
    "\n",
    "\n",
    "for word, meaning in roommate_details.items():\n",
    "        print(\"\\n\\n我知道的%s,\" % word.title() + '她:')\n",
    "        print(\"身高: \" + meaning['身高'])\n",
    "        print(\"爱好: \" + meaning['爱好'])\n",
    "        print(\"技能:\" + meaning['技能'])\n",
    "        \n",
    "\n",
    "roommate_details = {'小刘鸭': {'身高': '168', '爱好': '喜欢一团米', '技能':'哄一团米开心'},\n",
    "        '崔屎兰': {'身高': '162', '爱好': '学习', '技能':'疯狂学习不停止'},\n",
    "        '无敌漂亮的龙怡敏': {'身高': '168', '爱好': '生气', '技能':'只生小刘鸭一个人的气'},\n",
    "        }\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "军峰山海拔1760.9米\n",
      "九头岭海拔1794米\n",
      "玉京峰海拔1819.9米\n",
      "过风坳海拔1887米\n",
      "五虎岗海拔1891米\n",
      "武功山金顶(白鹤峰)海拔1918.3米\n",
      "齐云山海拔2061.3米\n",
      "南风面海拔2120.4米\n",
      "独竖尖海拔2128米\n",
      "黄岗山海拔2157.8米\n"
     ]
    }
   ],
   "source": [
    "moutains= {'军峰山': '海拔1760.9米',\n",
    "                '九头岭': '海拔1794米',\n",
    "                '玉京峰': '海拔1819.9米',\n",
    "           '过风坳': '海拔1887米',\n",
    "                '五虎岗': '海拔1891米',\n",
    "                '武功山金顶(白鹤峰)': '海拔1918.3米',\n",
    "                '齐云山': '海拔2061.3米',\n",
    "                '南风面': '海拔2120.4米',\n",
    "                '独竖尖': '海拔2128米',\n",
    "                '黄岗山': '海拔2157.8米'\n",
    "               \n",
    "                }\n",
    "\n",
    "for moutains_name, moutains_height in moutains.items():\n",
    "    print('%s' % moutains_name + '%s'% moutains_height)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
